package com.duobaoyu.dby.supply.db.entity.message;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.time.LocalDateTime;

/**
 * @author liyang
 * @version 1.0.0
 * @ClassName MqMessageConsumer
 * @Description MQ 消息消费记录表
 * @createTime 17:13:00 2023/03/23
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "mq消息")
@Document("sc_mq_message_consumer")
//@EqualsAndHashCode(callSuper = true)
@TableName("sc_mq_message_consumer")
public class MqMessageConsumer /*extends BaseEntity */{

	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@Id
	@TableId(type = IdType.INPUT)
	private String id;
	/**
	 * 主题
	 */
	@Field("topic")
	@ApiModelProperty(value = "topic")
	private String topic;
	/**
	 * 标签
	 */
	@Field("tag")
	@ApiModelProperty(value = "tag")
	private String tag;

	/**
	 * mq 发送状态
	 * 发送成功:SEND_OK
	 */
	@Field("status")
	@ApiModelProperty(value = "mq 发送状态 ",example = "SEND_OK")
	private String status;
	/**
	 * 业务消息唯一标识key
	 */
	@Field("unique_key")
	@ApiModelProperty("业务消息唯一标识key")
	private String uniqueKey;
	/**
	 * msgId
	 */
	@Field("msg_id")
	private String msgId;
	/**
	 * 消息链路ID
	 */
	@Field("message_link_id")
	@ApiModelProperty("消息链路ID")
	private String messageLinkId;
	/**
	 * 消息来源
	 */
	@Field("message_origin")
	@ApiModelProperty("消息来源")
	private String messageOrigin;
	/**
	 * 消费者来源
	 */
	@Field("origin")
	@ApiModelProperty(value = "消费者来源",example = "admin|job|api")
	private String origin;
	/**
	 * 版本号-用作乐观锁
	 */
	@Field("version")
	@ApiModelProperty(value = "版本号-用作乐观锁")
	@Version
	private Integer version;

	@Field("create_by")
	@TableField(fill = FieldFill.INSERT)
	private String createBy;

	@Field("create_time")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;

	@Field("update_by")
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private String updateBy;

	@Field("update_time")
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private LocalDateTime updateTime;
}
